// 使用装饰器实现文本高亮
const highlightDecorator: MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
  const method = descriptor.value

  descriptor.value = () => {
    return `<div style="color:red;">${method()}</div>`
  }
}

class User2 {
  @highlightDecorator
  public response() {
    return 'I AM CONTENT'
  }
}

let ele = document.createElement('div')
ele.innerHTML = new User2().response()
document.body.appendChild(ele)

